"""
type函数用法有两种
1.type（object）返回对象类型
2.type（name, father_class,function ）第四个参数可写可忽略，用于__int__subclass__()函数传参时使用
"""
print(type(1))
c = type('C', (), dict(x=250, ))
print(c.x)

'''
init_subclass函数的基本用法
class D:
    value = 0

    def __init_subclass__(cls, ):
        print("1111")
        cls.value = 250


class E(D):
    value = 520


e = E()
print(e.value)
'''


class D:
    value = 0

    def __init_subclass__(cls, kwargs):
        print("1111")
        cls.value = kwargs


d = type('C', (D,), dict(x=250), kwargs=520)
print(d.value)
